//
//  DIscountedTableViewCell.m
//  ProjectForA
//
//  Created by hmengwei on 14/11/21.
//  Copyright (c) 2014年 hmengwei. All rights reserved.
//

#import "DIscountedTableViewCell.h"

@implementation DIscountedTableViewCell

-(void)dealloc
{
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.image = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.lable1 = [[UILabel alloc] initWithFrame:CGRectZero];
        self.lable2 = [[UILabel alloc] initWithFrame:CGRectZero];
        self.lable3 = [[UILabel alloc] initWithFrame:CGRectZero];
        
         [self.contentView addSubview:_image];
        [self.contentView addSubview:_lable1];
        [self.contentView addSubview:_lable2];
        [self.contentView addSubview:_lable3];
       
        [_image release];
        [_lable1 release];
        [_lable2 release];
        [_lable3 release];
        
        
    }
    return self;
}


-(void)layoutSubviews
{
    [super layoutSubviews];
    
    _image.frame = CGRectMake(10, 10, self.frame.size.width - 20, self.frame.size.height - 20);
    _image.layer.cornerRadius = 10;
    _image.layer.masksToBounds = YES;
    
    _lable1.frame = CGRectMake(10, self.frame.size.height / 5 * 3, self.frame.size.width / 5 * 3, self.frame.size.height / 5 * 2 - 40);

    [_lable1 setTextColor:[UIColor whiteColor]];

    [_lable1 setNumberOfLines:0];
    
    _lable2.frame =CGRectMake(10, self.frame.size.height - 40, self.frame.size.width, 40);

    [_lable2 setFont:[UIFont systemFontOfSize:12]];
    [_lable2 setTextColor:[UIColor whiteColor]];
    
    _lable3.frame =CGRectMake(self.frame.size.width / 5 * 3.5, self.frame.size.height / 5 * 3, self.frame.size.width / 5 , _lable1.frame.size.height);
    
  
    
    
}







- (void)awakeFromNib {
    // Initialization code
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
